Copy My Stance V 4.1

21st November 2010.

By Caxton Gibbet

Description.
************

This addon will make a players AI team copy the players stance.

It would seem that the "Keep Low" command is not entirely a "copy my stance" order as 
indicated by the vocal command sometimes associated with a "Keep Low" order in game.
In fact when a 'keep low' order is issued to a unit parseing the 'Unitpos unit' command on that
unit returns the value "AUTO".
AI units will copy a prone or standing stance.I wanted them to also copy a crouch stance. 

This addon may be rendered obsolete by future game patches.

The scripts Detect Changes in the player's stance and issue updated stance rules to the 
players group.Any unit in the players group that is under stance rule "AUTO", 
'Keep Low' in menu 7,will act on these rule changes.Any unit that has been given any
other stance rule via menu 7 will retain those rules over those issued by the scripts.To
have those units return to the system,you need to issue them a "keep Low" order in menu 7.

New to this version of the addon is the key press control system.
As before the system is ON on ALL the players team at start up if the player is team leader.

You now have the ability to switch the system on and off on individuals or groups of your
team with a key press.

To switch the system OFF for a team member or members simply select them and press your
assigned "copy stance OFF" key.

To switch the system ON for a team member or members simply select them and press your
assigned "copy stance ON" key.

To have a team member or members remain in their current stance select them and press your 
assigned "Hold stance" key.

The first selected unit will confirm the command on behalf of all selected units.

The System sleeps while the player is in a vehicle or is not team leader or has no team members.

     *REMEMBER,"MENU 7" STANCE ORDERS ALWAYS TAKE PRIORITY.*
 *A "MENU 7","KEEP LOW" ORDER WILL RETURN THE UNIT TO THE SYSTEM.*

SETTING UP KEYS.
****************

1.Start the game.

2.Goto "OPTIONS".

3.Goto "CONTROLS".

4.The System watches for Input on 3 keys.You will need 3 keys to Assign to the addon in 
  the next steps.these keys should be unused.

5.(OPTIONAL):Assign all three keys to "TURBO",about half way down in "ALL CONTROLS", just before "Vehicle Turbo".

    WHY? well,if you don't do this you may find that the keys don't function properly when you are prone.
         Also,custom key presses maynot be registered while other keys are being pressed, (eg."Move forward").

    WHY? I've not a clue! but this is away round both issues.Simply moving your gun around while holding down the 
         key also solves the Prone issue.

    Caution: these three keys should not be used for TURBO while playing.Use your regular key or assign another.
             
6.Set the key filter to "CUSTOM CONTROLS".

7.Scroll to the very bottom.

8.Assign your three keys:

  Key for "Copy Stance ON" is    "Use Action 18"

  Key for "Copy Stance OFF" is   "Use Action 19"

  Key for "HOLD Stance" is       "Use Action 20"

All Done.

REQUIREMENTS.
*************
You will need the latest version of CBA ('extended_init_eventhandlers')

find it here: [url]http://dev-heaven.net/projects/list_files/cca[/url]

or here:  [url]http://www.armaholic.com/page.php?id=6231[/url]

LIMITATIONS\ISSUES
*******************
The Addon maynot initiate on some custom units.However as long as atleast
one unit within the mission is of a compatable type (eg. any vanilla units)
the addon will initiate on the players unit.

The addon can be forced on within a mission that contains only non compatable units
using the following code somwhere in the mission.

nul = [] execVM "GIB_Copy_Stance\GIB_Copy_Stance_FORCE.sqf";

HISTORY
********
V.4.1

Fixed: Commanding menu will now close once an order has been given.

V.4.0

Fixed: Removed action menu addition which was causing the Issue with armoury mode.

Added: key detection to replace action menu addition.

Added: Ability to switch system on and off for idividual or groups of units.

Added: Ability to command units or groups of units to remain in their current stance.

V.3.01

Fixed: Removed Debug text "RUN" which was left in by mistake.

V.3.0

Added: Support for Prone with launcher animation from SLX and ACE2.(Mods NOT Required).
Fixed: Player static crouch not being seen on mod start up.

V.2.03

Created a Work around for the addons faliure to initiate on some addon units.

-As long as ANY unit type on which the addon initiates is present 
 in the mission,(eg. ANY vanila units including mounted crew and pilots),then
 the addon will initiate on the player.

V.2.02

binarized addon.

V.2.01

Added: checks for player using binoculars and laser designator.

Added: checks for unarmed player.

V.2.00

refined the system and then Re-wrote all scripts in .sqf format.

Fixed: Issues around teamswitch and joining or leaving Groups.

V.1.00

Initial release

DISCLAIMER ETC..
****************

Use at your own risk.

Don't use for commercial purposes.

Only redistribute unaltered and with this readme.

Please direct all enquiries via the BIS forums thread or by PM.

Caxton Gibbet.